<?php
//前台首页
Route::get('/', 'IndexController@index');

//后台登录页
Route::get('admin/login', 'Admin\LoginController@index');
//后台登录认证
Route::post('admin/doLogin', 'Admin\LoginController@doLogin');

Route::group(['prefix' => 'admin', 'middleware' => 'adminIsLogin', 'namespace' => 'Admin'], function () {

    //后台首页
    Route::get('/', 'IndexController@index');
    //管理员注销
    Route::get('logout', 'IndexController@logout');

    //显示位置
    Route::get('show_position', 'ShowPositionController@index');
    Route::any('show_position/add', 'ShowPositionController@add');
    Route::post('show_position/del', 'ShowPositionController@del');
    Route::any('show_position/edit/{id}', 'ShowPositionController@edit')
        ->name('showPositionEdit');

    //栏目
    Route::get('category', 'CategoryController@index');
    Route::any('category/add', 'CategoryController@add');
    Route::post('category/del', 'CategoryController@del');
    Route::any('category/edit/{id}', 'CategoryController@edit')
        ->name('categoryEdit');

    //文章
    Route::get('article', 'ArticleController@index');
    Route::any('article/add', 'ArticleController@add');
    Route::post('article/del', 'ArticleController@del');
    Route::any('article/edit/{id}', 'ArticleController@edit')
        ->name('articleEdit');

    //管理员
    Route::get('member', 'MemberController@index');
    Route::any('member/add', 'MemberController@add');
    Route::post('member/del', 'MemberController@del');
    Route::any('member/edit/{id}', 'MemberController@edit')
        ->name('memberEdit');

});